//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft Corporation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function asmModule(stdlib, imports) {
    "use asm";
    var i4 = stdlib.SIMD.Int32x4;
    var i4check = i4.check;
    var i4splat = i4.splat;

    var i4fromFloat32x4 = i4.fromFloat32x4;
    var i4fromFloat32x4Bits = i4.fromFloat32x4Bits;
    var i4neg = i4.neg;
    var i4add = i4.add;
    var i4sub = i4.sub;
    var i4mul = i4.mul;
    var i4lessThan = i4.lessThan;
    var i4equal = i4.equal;
    var i4greaterThan = i4.greaterThan;
    var i4select = i4.select;

    var f4 = stdlib.SIMD.Float32x4;
    var f4check = f4.check;
    var f4splat = f4.splat;

    var f4fromInt32x4 = f4.fromInt32x4;
    var f4fromUint32x4 = f4.fromUint32x4;
    var f4fromInt32x4Bits = f4.fromInt32x4Bits;

    var f4fromInt16x8Bits = f4.fromInt16x8Bits;
    var f4fromInt8x16Bits = f4.fromInt8x16Bits;
    var f4fromUint32x4Bits = f4.fromUint32x4Bits;
    var f4fromUint16x8Bits = f4.fromUint16x8Bits;
    var f4fromUint8x16Bits = f4.fromUint8x16Bits;

    var f4abs = f4.abs;
    var f4neg = f4.neg;
    var f4add = f4.add;
    var f4sub = f4.sub;
    var f4mul = f4.mul;
    var f4div = f4.div;

    var f4min = f4.min;
    var f4max = f4.max;

    var f4sqrt = f4.sqrt;
    //var f4swizzle = f4.swizzle;
    //var f4shuffle = f4.shuffle;
    var f4lessThan = f4.lessThan;
    var f4lessThanOrEqual = f4.lessThanOrEqual;
    var f4equal = f4.equal;
    var f4notEqual = f4.notEqual;
    var f4greaterThan = f4.greaterThan;
    var f4greaterThanOrEqual = f4.greaterThanOrEqual;

    var f4select = f4.select;
    var i8 = stdlib.SIMD.Int16x8;
    var i8check = i8.check;

    var u4 = stdlib.SIMD.Uint32x4;
    var u4check = u4.check;
    var u8 = stdlib.SIMD.Uint16x8;
    var u8check = u8.check;

    var u16 = stdlib.SIMD.Uint8x16;
    var u16check = u16.check;

    var i16 = stdlib.SIMD.Int8x16;
    var i16check = i16.check;

    var fround = stdlib.Math.fround;

    var g1 = f4(5033.2,3401.0,665.34,32234.1);          // global var initialized
    var g2 = i4(1065353216, 1073741824,1077936128, 1082130432);
    var g3 = u4(3216, -1, 0, -1082130432);

    var g4 = i8(106516, 1073741824,1077936128, 108213032, -1065353216, -1073741824,-1077936128, -1082130432);
    var g5 = u4(106553216, 10737824,77936128, 108132);
    var g6 = u8(1065353216, 1073741824,1077936128, 1082130432, -1065353216, -1073741824,-1077936128, -1082130432);
    var g7 = u16(106535, 1014824,1076128, 108212, -1065353216, -1073724,-77936128, -1082130432, 10653216, 1741824, 7936128, 108432, -103216, -1741824, -1128, -1082130432);
    var g8 = i16(106516, 1073741824,1077936128, 108213032, -1065353216, -1073741824,-1077936128, -1082130432, 106516, 1073741824,1077936128, 108213032, -1065353216, -1073741824,-1077936128, -1082130432);
    var gval = 1234;
    var gval2 = 1234.0;

    var loopIndex = 0;
    var loopCOUNT = 3;

    function func1()
    {
        var x0 = f4(0.0,0.0,0.0,0.0);
        var x1 = f4(0.0,0.0,0.0,0.0);
        var x2 = f4(0.0,0.0,0.0,0.0);
        var x3 = f4(0.0,0.0,0.0,0.0);
        var x4 = f4(0.0,0.0,0.0,0.0);
        var x5 = f4(0.0,0.0,0.0,0.0);
        var x6 = f4(0.0,0.0,0.0,0.0);
        var x7 = f4(0.0,0.0,0.0,0.0);
        var x8 = f4(0.0,0.0,0.0,0.0);
        var x9 = f4(0.0,0.0,0.0,0.0);
        var x10 = f4(0.0,0.0,0.0,0.0);
        var x11 = f4(0.0,0.0,0.0,0.0);
        var x12 = f4(0.0,0.0,0.0,0.0);
        var x13 = f4(0.0,0.0,0.0,0.0);
        var x14 = f4(0.0,0.0,0.0,0.0);
        var x15 = f4(0.0,0.0,0.0,0.0);
        var x16 = f4(0.0,0.0,0.0,0.0);
        var x17 = f4(0.0,0.0,0.0,0.0);
        var x18 = f4(0.0,0.0,0.0,0.0);
        var x19 = f4(0.0,0.0,0.0,0.0);
        var x20 = f4(0.0,0.0,0.0,0.0);
        var x21 = f4(0.0,0.0,0.0,0.0);
        var x22 = f4(0.0,0.0,0.0,0.0);
        var x23 = f4(0.0,0.0,0.0,0.0);
        var x24 = f4(0.0,0.0,0.0,0.0);
        var x25 = f4(0.0,0.0,0.0,0.0);
        var x26 = f4(0.0,0.0,0.0,0.0);
        var x27 = f4(0.0,0.0,0.0,0.0);
        var x28 = f4(0.0,0.0,0.0,0.0);
        var x29 = f4(0.0,0.0,0.0,0.0);
        var x30 = f4(0.0,0.0,0.0,0.0);
        var x31 = f4(0.0,0.0,0.0,0.0);
        var x32 = f4(0.0,0.0,0.0,0.0);
        var x33 = f4(0.0,0.0,0.0,0.0);
        var x34 = f4(0.0,0.0,0.0,0.0);
        var x35 = f4(0.0,0.0,0.0,0.0);
        var x36 = f4(0.0,0.0,0.0,0.0);
        var x37 = f4(0.0,0.0,0.0,0.0);
        var x38 = f4(0.0,0.0,0.0,0.0);
        var x39 = f4(0.0,0.0,0.0,0.0);
        var x40 = f4(0.0,0.0,0.0,0.0);
        var x41 = f4(0.0,0.0,0.0,0.0);
        var x42 = f4(0.0,0.0,0.0,0.0);
        var x43 = f4(0.0,0.0,0.0,0.0);
        var x44 = f4(0.0,0.0,0.0,0.0);
        var x45 = f4(0.0,0.0,0.0,0.0);
        var x46 = f4(0.0,0.0,0.0,0.0);
        var x47 = f4(0.0,0.0,0.0,0.0);
        var x48 = f4(0.0,0.0,0.0,0.0);
        var x49 = f4(0.0,0.0,0.0,0.0);
        var x50 = f4(0.0,0.0,0.0,0.0);
        var x51 = f4(0.0,0.0,0.0,0.0);
        var x52 = f4(0.0,0.0,0.0,0.0);
        var x53 = f4(0.0,0.0,0.0,0.0);
        var x54 = f4(0.0,0.0,0.0,0.0);
        var x55 = f4(0.0,0.0,0.0,0.0);
        var x56 = f4(0.0,0.0,0.0,0.0);
        var x57 = f4(0.0,0.0,0.0,0.0);
        var x58 = f4(0.0,0.0,0.0,0.0);
        var x59 = f4(0.0,0.0,0.0,0.0);
        var x60 = f4(0.0,0.0,0.0,0.0);
        var x61 = f4(0.0,0.0,0.0,0.0);
        var x62 = f4(0.0,0.0,0.0,0.0);
        var x63 = f4(0.0,0.0,0.0,0.0);
        var x64 = f4(0.0,0.0,0.0,0.0);
        var x65 = f4(0.0,0.0,0.0,0.0);
        var x66 = f4(0.0,0.0,0.0,0.0);
        var x67 = f4(0.0,0.0,0.0,0.0);
        var x68 = f4(0.0,0.0,0.0,0.0);
        var x69 = f4(0.0,0.0,0.0,0.0);
        var x70 = f4(0.0,0.0,0.0,0.0);
        var x71 = f4(0.0,0.0,0.0,0.0);
        var x72 = f4(0.0,0.0,0.0,0.0);
        var x73 = f4(0.0,0.0,0.0,0.0);
        var x74 = f4(0.0,0.0,0.0,0.0);
        var x75 = f4(0.0,0.0,0.0,0.0);
        var x76 = f4(0.0,0.0,0.0,0.0);
        var x77 = f4(0.0,0.0,0.0,0.0);
        var x78 = f4(0.0,0.0,0.0,0.0);
        var x79 = f4(0.0,0.0,0.0,0.0);
        var x80 = f4(0.0,0.0,0.0,0.0);
        var x81 = f4(0.0,0.0,0.0,0.0);
        var x82 = f4(0.0,0.0,0.0,0.0);
        var x83 = f4(0.0,0.0,0.0,0.0);
        var x84 = f4(0.0,0.0,0.0,0.0);
        var x85 = f4(0.0,0.0,0.0,0.0);
        var x86 = f4(0.0,0.0,0.0,0.0);
        var x87 = f4(0.0,0.0,0.0,0.0);
        var x88 = f4(0.0,0.0,0.0,0.0);
        var x89 = f4(0.0,0.0,0.0,0.0);
        var x90 = f4(0.0,0.0,0.0,0.0);
        var x91 = f4(0.0,0.0,0.0,0.0);
        var x92 = f4(0.0,0.0,0.0,0.0);
        var x93 = f4(0.0,0.0,0.0,0.0);
        var x94 = f4(0.0,0.0,0.0,0.0);
        var x95 = f4(0.0,0.0,0.0,0.0);
        var x96 = f4(0.0,0.0,0.0,0.0);
        var x97 = f4(0.0,0.0,0.0,0.0);
        var x98 = f4(0.0,0.0,0.0,0.0);
        var x99 = f4(0.0,0.0,0.0,0.0);
        var x100 = f4(0.0,0.0,0.0,0.0);
        var x101 = f4(0.0,0.0,0.0,0.0);
        var x102 = f4(0.0,0.0,0.0,0.0);
        var x103 = f4(0.0,0.0,0.0,0.0);
        var x104 = f4(0.0,0.0,0.0,0.0);
        var x105 = f4(0.0,0.0,0.0,0.0);
        var x106 = f4(0.0,0.0,0.0,0.0);
        var x107 = f4(0.0,0.0,0.0,0.0);
        var x108 = f4(0.0,0.0,0.0,0.0);
        var x109 = f4(0.0,0.0,0.0,0.0);
        var x110 = f4(0.0,0.0,0.0,0.0);
        var x111 = f4(0.0,0.0,0.0,0.0);
        var x112 = f4(0.0,0.0,0.0,0.0);
        var x113 = f4(0.0,0.0,0.0,0.0);
        var x114 = f4(0.0,0.0,0.0,0.0);
        var x115 = f4(0.0,0.0,0.0,0.0);
        var x116 = f4(0.0,0.0,0.0,0.0);
        var x117 = f4(0.0,0.0,0.0,0.0);
        var x118 = f4(0.0,0.0,0.0,0.0);
        var x119 = f4(0.0,0.0,0.0,0.0);
        var x120 = f4(0.0,0.0,0.0,0.0);
        var x121 = f4(0.0,0.0,0.0,0.0);
        var x122 = f4(0.0,0.0,0.0,0.0);
        var x123 = f4(0.0,0.0,0.0,0.0);
        var x124 = f4(0.0,0.0,0.0,0.0);
        var x125 = f4(0.0,0.0,0.0,0.0);
        var x126 = f4(0.0,0.0,0.0,0.0);
        var x127 = f4(0.0,0.0,0.0,0.0);
        var x128 = f4(0.0,0.0,0.0,0.0);
        var x129 = f4(0.0,0.0,0.0,0.0);
        var x130 = f4(0.0,0.0,0.0,0.0);
        var x131 = f4(0.0,0.0,0.0,0.0);
        var x132 = f4(0.0,0.0,0.0,0.0);
        var x133 = f4(0.0,0.0,0.0,0.0);
        var x134 = f4(0.0,0.0,0.0,0.0);
        var x135 = f4(0.0,0.0,0.0,0.0);
        var x136 = f4(0.0,0.0,0.0,0.0);
        var x137 = f4(0.0,0.0,0.0,0.0);
        var x138 = f4(0.0,0.0,0.0,0.0);
        var x139 = f4(0.0,0.0,0.0,0.0);
        var x140 = f4(0.0,0.0,0.0,0.0);
        var x141 = f4(0.0,0.0,0.0,0.0);
        var x142 = f4(0.0,0.0,0.0,0.0);
        var x143 = f4(0.0,0.0,0.0,0.0);
        var x144 = f4(0.0,0.0,0.0,0.0);
        var x145 = f4(0.0,0.0,0.0,0.0);
        var x146 = f4(0.0,0.0,0.0,0.0);
        var x147 = f4(0.0,0.0,0.0,0.0);
        var x148 = f4(0.0,0.0,0.0,0.0);
        var x149 = f4(0.0,0.0,0.0,0.0);
        var x150 = f4(0.0,0.0,0.0,0.0);
        var x151 = f4(0.0,0.0,0.0,0.0);
        var x152 = f4(0.0,0.0,0.0,0.0);
        var x153 = f4(0.0,0.0,0.0,0.0);
        var x154 = f4(0.0,0.0,0.0,0.0);
        var x155 = f4(0.0,0.0,0.0,0.0);
        var x156 = f4(0.0,0.0,0.0,0.0);
        var x157 = f4(0.0,0.0,0.0,0.0);
        var x158 = f4(0.0,0.0,0.0,0.0);
        var x159 = f4(0.0,0.0,0.0,0.0);
        var x160 = f4(0.0,0.0,0.0,0.0);
        var x161 = f4(0.0,0.0,0.0,0.0);
        var x162 = f4(0.0,0.0,0.0,0.0);
        var x163 = f4(0.0,0.0,0.0,0.0);
        var x164 = f4(0.0,0.0,0.0,0.0);
        var x165 = f4(0.0,0.0,0.0,0.0);
        var x166 = f4(0.0,0.0,0.0,0.0);
        var x167 = f4(0.0,0.0,0.0,0.0);
        var x168 = f4(0.0,0.0,0.0,0.0);
        var x169 = f4(0.0,0.0,0.0,0.0);
        var x170 = f4(0.0,0.0,0.0,0.0);
        var x171 = f4(0.0,0.0,0.0,0.0);
        var x172 = f4(0.0,0.0,0.0,0.0);
        var x173 = f4(0.0,0.0,0.0,0.0);
        var x174 = f4(0.0,0.0,0.0,0.0);
        var x175 = f4(0.0,0.0,0.0,0.0);
        var x176 = f4(0.0,0.0,0.0,0.0);
        var x177 = f4(0.0,0.0,0.0,0.0);
        var x178 = f4(0.0,0.0,0.0,0.0);
        var x179 = f4(0.0,0.0,0.0,0.0);
        var x180 = f4(0.0,0.0,0.0,0.0);
        var x181 = f4(0.0,0.0,0.0,0.0);
        var x182 = f4(0.0,0.0,0.0,0.0);
        var x183 = f4(0.0,0.0,0.0,0.0);
        var x184 = f4(0.0,0.0,0.0,0.0);
        var x185 = f4(0.0,0.0,0.0,0.0);
        var x186 = f4(0.0,0.0,0.0,0.0);
        var x187 = f4(0.0,0.0,0.0,0.0);
        var x188 = f4(0.0,0.0,0.0,0.0);
        var x189 = f4(0.0,0.0,0.0,0.0);
        var x190 = f4(0.0,0.0,0.0,0.0);
        var x191 = f4(0.0,0.0,0.0,0.0);
        var x192 = f4(0.0,0.0,0.0,0.0);
        var x193 = f4(0.0,0.0,0.0,0.0);
        var x194 = f4(0.0,0.0,0.0,0.0);
        var x195 = f4(0.0,0.0,0.0,0.0);
        var x196 = f4(0.0,0.0,0.0,0.0);
        var x197 = f4(0.0,0.0,0.0,0.0);
        var x198 = f4(0.0,0.0,0.0,0.0);
        var x199 = f4(0.0,0.0,0.0,0.0);
        var x200 = f4(0.0,0.0,0.0,0.0);
        var x201 = f4(0.0,0.0,0.0,0.0);
        var x202 = f4(0.0,0.0,0.0,0.0);
        var x203 = f4(0.0,0.0,0.0,0.0);
        var x204 = f4(0.0,0.0,0.0,0.0);
        var x205 = f4(0.0,0.0,0.0,0.0);
        var x206 = f4(0.0,0.0,0.0,0.0);
        var x207 = f4(0.0,0.0,0.0,0.0);
        var x208 = f4(0.0,0.0,0.0,0.0);
        var x209 = f4(0.0,0.0,0.0,0.0);
        var x210 = f4(0.0,0.0,0.0,0.0);
        var x211 = f4(0.0,0.0,0.0,0.0);
        var x212 = f4(0.0,0.0,0.0,0.0);
        var x213 = f4(0.0,0.0,0.0,0.0);
        var x214 = f4(0.0,0.0,0.0,0.0);
        var x215 = f4(0.0,0.0,0.0,0.0);
        var x216 = f4(0.0,0.0,0.0,0.0);
        var x217 = f4(0.0,0.0,0.0,0.0);
        var x218 = f4(0.0,0.0,0.0,0.0);
        var x219 = f4(0.0,0.0,0.0,0.0);
        var x220 = f4(0.0,0.0,0.0,0.0);
        var x221 = f4(0.0,0.0,0.0,0.0);
        var x222 = f4(0.0,0.0,0.0,0.0);
        var x223 = f4(0.0,0.0,0.0,0.0);
        var x224 = f4(0.0,0.0,0.0,0.0);
        var x225 = f4(0.0,0.0,0.0,0.0);
        var x226 = f4(0.0,0.0,0.0,0.0);
        var x227 = f4(0.0,0.0,0.0,0.0);
        var x228 = f4(0.0,0.0,0.0,0.0);
        var x229 = f4(0.0,0.0,0.0,0.0);
        var x230 = f4(0.0,0.0,0.0,0.0);
        var x231 = f4(0.0,0.0,0.0,0.0);
        var x232 = f4(0.0,0.0,0.0,0.0);
        var x233 = f4(0.0,0.0,0.0,0.0);
        var x234 = f4(0.0,0.0,0.0,0.0);
        var x235 = f4(0.0,0.0,0.0,0.0);
        var x236 = f4(0.0,0.0,0.0,0.0);
        var x237 = f4(0.0,0.0,0.0,0.0);
        var x238 = f4(0.0,0.0,0.0,0.0);
        var x239 = f4(0.0,0.0,0.0,0.0);
        var x240 = f4(0.0,0.0,0.0,0.0);
        var x241 = f4(0.0,0.0,0.0,0.0);
        var x242 = f4(0.0,0.0,0.0,0.0);
        var x243 = f4(0.0,0.0,0.0,0.0);
        var x244 = f4(0.0,0.0,0.0,0.0);
        var x245 = f4(0.0,0.0,0.0,0.0);
        var x246 = f4(0.0,0.0,0.0,0.0);
        var x247 = f4(0.0,0.0,0.0,0.0);
        var x248 = f4(0.0,0.0,0.0,0.0);
        var x249 = f4(0.0,0.0,0.0,0.0);
        var x250 = f4(0.0,0.0,0.0,0.0);
        var x251 = f4(0.0,0.0,0.0,0.0);
        var x252 = f4(0.0,0.0,0.0,0.0);
        var x253 = f4(0.0,0.0,0.0,0.0);
        var x254 = f4(0.0,0.0,0.0,0.0);
        var x255 = f4(0.0,0.0,0.0,0.0);
        var x256 = i8(0, 0, 0, 0, 0, 0, 0, 0);

        return x255;
    }

    return {func1 : func1};
}

var m = asmModule(this, {}).func1();

WScript.Echo("PASS");
